/*
 * @Author: yangrongxin
 * @Date: 2021-08-03 17:08:05
 * @LastEditors: liubin
 * @LastEditTime: 2021-10-20 14:28:43
 */
import { useState } from 'react';
import { AtIcon } from 'taro-ui';
import Taro from '@tarojs/taro';
import { View, Input } from '@tarojs/components';
import styles from './index.module.less';

const NavBarSearch = ({ currentFrom = 0, placeholder = '搜索测评及宣教资讯', isHome = false, isNormal = false }) => {
  const onActionClick = () => {
    Taro.navigateTo({
      url: `/pages/SearchPage/index?currentFrom=${currentFrom}`,
    });
  };

  return (
    <View
      className={`${styles.container} ${isHome ? styles.homeExtend : ''} ${isNormal ? styles.normalContent : ''}`}
      onClick={onActionClick}
    >
      {/* 展示对应的Input框 点击之后进入搜索页面 */}
      <AtIcon value="search" size="14" />
      <Input placeholder={placeholder} disabled />
    </View>
  );
};

export default NavBarSearch;
